[R3]: Move to new vLLM routed experts format#2487
Merged
Merged
Conversation
bf79561 to
721a874
Compare
bc91c30 to
e55328f
Compare
e55328f to
1fea38e
Compare
samsja
previously approved these changes
May 15, 2026
* Guard checkpoint disk metrics mkdir * Remove test_trainer_utils.py per review feedback Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Simplify ckpt disk metrics guard Drop the rank-0 gate and the disk_usage path fallback per review feedback. Catching FileExistsError on mkdir is sufficient: every rank that races on mkdir either wins or harmlessly catches the BeegFS race, and shutil.disk_usage can then operate on the now-existing ckpt_dir. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
64d3f2c to
cb3c559
Compare
cb3c559 to
4402d7e
Compare
…erts # Conflicts: # pyproject.toml # src/prime_rl/inference/patches.py # src/prime_rl/inference/vllm/serving_chat_with_tokens.py # src/prime_rl/inference/vllm/serving_tokens.py # src/prime_rl/orchestrator/trajectories.py # src/prime_rl/trainer/batch.py # src/prime_rl/trainer/rl/data.py # tests/unit/orchestrator/test_batch.py # uv.lock
11fe0ad to
de71036
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit fbf16de. Configure here.
mikasenghaas
previously approved these changes
May 22, 2026
samsja
approved these changes
May 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

PR is ready - routed-experts vLLM pin rebuilt from v0.21.0 + revert #42434 + PR39568
This branch moves prime-rl to the routed-experts response path used by current
renderers/verifiersmain, without the verifier-side renderer bypass. The x86_64 vLLM pin now points at a PrimeIntellectv0.5.0release asset built from upstream vLLMreleases/v0.21.0plus upstream revert vllm-project/vllm#42434 and upstream PR vllm-project/vllm#39568.The previous PR39568-only wheel still contained the PR39917 validation that rejected
enable_return_routed_expertswith async scheduling during inference startup. This new wheel removes that validation via revert #42434 while keeping the PR39568 routed-experts transfer path.RoutedExperts(data, shape, dtype), explicit dtype maps, and_pack_routed_experts/_unpack_routed_expertsfor multi-turn stitchingRoutedExpertstransport struct withtorch.frombuffervllm-routerto0.1.25for the matching raw-uint8schema and addpybase64vllm-0.21.0+cu129.r42434.pr39568.a106aa6-cp38-abi3-manylinux_2_24_x86_64.whldeps/renderersto main3ae276c(renderers-v0.1.8.dev25), including routed-experts sidecar parsing andfastokens>=0.2.0deps/verifiersto main521d436c(v0.1.15.dev8-1-g521d436c), including the routed-experts response sidecar support and verifier helper cleanupfastokensexclude-newer exemption and lockfastokens==0.2.0to satisfy current renderers mainRelated PRs
Verification
uv sync --all-extras --lockeduv lock --lockeduv run ruff check .uv run ruff format --check --config=pyproject.tomlPYTEST_OUTPUT_DIR=/tmp/outputs uv run pytest tests/unit -m "not gpu"- 454 passed, 65 deselected, 35 warningsvllm.__version__ == "0.21.0+cu129.r42434.pr39568.a106aa6",ModelRunnerOutput.routed_expertspresent,_validate_return_routed_expertsabsent, and the old async-scheduling validation string absent.r42434.pr39568.a106aa6vLLM wheel to theprime-rlv0.5.0release and removed the stale PR39568-only wheel asset that failed inference startup.Note
Medium Risk
Medium risk because this changes the
routed_expertswire/transport format end-to-end (inference response → orchestrator → trainer) and adds a vLLM monkey-patch for NIXL disaggregated inference, which could break router-replay or inference compatibility if assumptions drift.Overview
Updates prime-rl to the new vLLM routed-experts schema by exporting routing decisions as a compact base64-encoded
uint8byte payload (plus shape) from/inference/v1/generate, and decoding/packing it at the orchestrator boundary instead of propagating nested Python lists.Introduces a
RoutedExpertsmsgpack transport struct and refactors trainer batching/packing to slice/append/pad routed-experts using raw bytes, reconstructing tensors viatorch.frombuffer. Adds config validation to reject router replay wheninference.kv_cache_offloadis enabled, and includes a vLLM__post_init__monkey-patch to allow routed-experts capture with theNixlConnectorin P/D disaggregated inference.Bumps dependency pins to match the new protocol (
vllm-router0.1.25, x86_64 vLLM wheel), addspybase64, and updates/extends unit tests to cover the new serialization and transport behavior.Reviewed by Cursor Bugbot for commit c3ffa15. Bugbot is set up for automated code reviews on this repo. Configure here.